package fun.anin.aninhongbao.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import fun.anin.aninhongbao.entity.RedPacketRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 抢红包记录表(RedPacketRecord)表数据库访问层
 *
 * @author makejava
 * @since 2020-03-31 17:56:50
 */
@Mapper
public interface RedPacketRecordDao extends BaseMapper<RedPacketRecord> {

    /**
     * 标记为运气王
     * @param record    记录实体
     * @return          结果
     */
    @Update("UPDATE `red_packet_record` SET is_luck = 1 WHERE red_packet_id = #{redPacketId} AND uid = #{uid}")
    int markAsLuck(RedPacketRecord record);
}